﻿namespace PublicModels.Draft;

/// <summary>
/// 地图注记
/// </summary>
public class Annotation
{
    public Annotation()
    {

    }

    public Annotation(string wkt)
    {
        FeatureInWKT = wkt;
    }
    
    [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
    public int ID { get; set; }

    [SugarColumn(ColumnDataType = "geometry", ColumnName = "feature")]
    public string FeatureInWKT { get; set; } = string.Empty;

    public int OwnerID { get; set; }

    [SugarColumn(IsIgnore = true)]
    public Geometry FeatureInGeometry => WktReader.Parse<Geometry>(FeatureInWKT);

    public override string ToString() => JsonConvert.SerializeObject(this);
}
